home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 May: Tool Chest / Developer CD Series Tool Chest (Apple Computer)(May 1999).iso / Tool Chest / Development Kits / MPW etc / Miscellaneous / WorkSets / WorkSets.dialog / Startup Items / UserStartup•WorkSets.dialog
Encoding:
Text File  |  1996-03-20  |  5.3 KB  |  184 lines  |  [TEXT/MPS ]

  1. # ************************************************************
  2. #     UserStartup•WorkSets.dialog
  3. #     Defines the dialog based workset menu items in the Files menu.
  4. #     Requires MPW Shell 3.4.2b1c3, for the "-e" option to the Windows command.
  5. #     Copyright Apple Computer,Inc.  1996
  6. #     All rights reserved
  7. # ************************************************************
  8.  
  9. #
  10. #   A "WorkSet" is a set of related windows which you want to open, close, hide, or
  11. # show as a group.  For example, these can be the windows you need while working on
  12. # a particular bug fix or new feature.
  13. #   Each "WorkSet" is defined by a file in the new "{MPW}WorkSets:" folder.  Each 
  14. # file simply contains a list of the full pathnames of the files in the workset.
  15. #
  16. Set Exit 0
  17.  
  18. #
  19. # Create the WorkSets folder if it doesn't already exist.
  20. #
  21. If (! `Exists -d "{MPW}WorkSets:"`)
  22.     NewFolder "{MPW}WorkSets:"
  23. End
  24.  
  25. #
  26. # Create an initial WorkSet, if one doesn't already exist.
  27. #
  28. If ("`Files "{MPW}WorkSets:"`" == "")
  29.     Windows -e > "{MPW}WorkSets:Initial WorkSet"    # Don't include the WorkSheet.
  30. End
  31.  
  32. #
  33. # Adding a number to a line in a menu allows you to explicitly reference it.
  34. # This avoids duplicating the line.
  35. #
  36. AddMenu File '(-8' ''
  37.  
  38. #
  39. # Add each item in turn.
  40. #
  41. # Each menu item gets the current list of workset files, builds a dialog box
  42. # to allow the user to select the correct item, and then acts on the selected item.
  43. # "Edit WorkSet..." is special, in that it needs to add and handle the "New..." option.
  44. # All the extra deltas (∂) are needed for the extra level of evaluation introduced
  45. # through the AddMenu command.
  46. #
  47. AddMenu File "Edit WorkSet..." ∂
  48.   " ∂
  49.     Set CurDir1 ∂`Directory∂`; ∂
  50.     Directory ∂"{MPW}WorkSets:∂"; ∂
  51.     Set Exit 0; ∂
  52.     Set xxxWorkSetList ∂"New... ∂`Files∂`∂"; ∂
  53.     Set xxxAWorkSet ∂"∂`GetListItem ∂{xxxWorkSetList∂} -m 'Select WorkSet:'; Set xStatus ∂{Status∂};∂`∂"; ∂
  54.     If (∂{xStatus∂} == 0); ∂
  55.         If (∂"∂{xxxAWorkSet∂}∂" == ∂"New...∂"); ∂
  56.             Open -n ∂"∂`Request ∂"Name of work set:∂"∂`∂"; ∂
  57.             Windows -e > ∂"∂{Active∂}∂" ; ∂
  58.             Save ∂"∂{Active∂}∂" ; ∂
  59.         Else; ∂
  60.             Open ∂{xxxAWorkSet∂}; ∂
  61.         End; ∂
  62.     End; ∂
  63.     Directory ∂"∂{CurDir1∂}∂"; ∂
  64.     Set Exit 1; ∂
  65.   "
  66.  
  67. AddMenu File 'Remove WorkSet...' ∂
  68.   " ∂
  69.     Set CurDir1 ∂`Directory∂`; ∂
  70.     Directory ∂"{MPW}WorkSets:∂"; ∂
  71.     Set Exit 0; ∂
  72.     Set xxxWorkSetList ∂"∂`Files∂`∂"; ∂
  73.     If (∂"∂{xxxWorkSetList∂}∂" == ∂"∂"); ∂
  74.         Alert "There are no WorkSets currently defined."; ∂
  75.     Else; ∂
  76.         Set xxxAWorkSet ∂"∂`GetListItem ∂{xxxWorkSetList∂} -m 'Select WorkSet:'; Set xStatus ∂{Status∂};∂`∂"; ∂
  77.         If (∂{xStatus∂} == 0); ∂
  78.             (Close -y ∂"{MPW}WorkSets:∂"∂{xxxAWorkSet∂}) ∑ Dev:Null ; ∂
  79.             (Delete -i ∂"{MPW}WorkSets:∂"∂{xxxAWorkSet∂}) ∑ Dev:Null ; ∂
  80.         End; ∂
  81.     End; ∂
  82.     Directory ∂"∂{CurDir1∂}∂"; ∂
  83.     Set Exit 1; ∂
  84.   "
  85.  
  86. AddMenu File '(-9' ''
  87.  
  88. AddMenu File 'Open WorkSet...' ∂
  89.   " ∂
  90.     Set CurDir1 ∂`Directory∂`; ∂
  91.     Directory ∂"{MPW}WorkSets:∂"; ∂
  92.     Set Exit 0; ∂
  93.     Set xxxWorkSetList ∂"∂`Files∂`∂"; ∂
  94.     If (∂"∂{xxxWorkSetList∂}∂" == ∂"∂"); ∂
  95.         Alert "There are no WorkSets currently defined."; ∂
  96.     Else; ∂
  97.         Set xxxAWorkSet ∂"∂`GetListItem ∂{xxxWorkSetList∂} -m 'Select WorkSet:'; Set xStatus ∂{Status∂};∂`∂"; ∂
  98.         If (∂{xStatus∂} == 0); ∂
  99.             Open ∂`Catenate ∂{xxxAWorkSet∂}∂`; ∂
  100.         End; ∂
  101.     End; ∂
  102.     Directory ∂"∂{CurDir1∂}∂"; ∂
  103.     Set Exit 1; ∂
  104.   "
  105.  
  106. AddMenu File 'Close WorkSet...' ∂
  107.   " ∂
  108.     Set CurDir1 ∂`Directory∂`; ∂
  109.     Directory ∂"{MPW}WorkSets:∂"; ∂
  110.     Set Exit 0; ∂
  111.     Set xxxWorkSetList ∂"∂`Files∂`∂"; ∂
  112.     If (∂"∂{xxxWorkSetList∂}∂" == ∂"∂"); ∂
  113.         Alert "There are no WorkSets currently defined."; ∂
  114.     Else; ∂
  115.         Set xxxAWorkSet ∂"∂`GetListItem ∂{xxxWorkSetList∂} -m 'Select WorkSet:'; Set xStatus ∂{Status∂};∂`∂"; ∂
  116.         If (∂{xStatus∂} == 0); ∂
  117.             Close ∂`Catenate ∂{xxxAWorkSet∂}∂`; ∂
  118.         End; ∂
  119.     End; ∂
  120.     Directory ∂"∂{CurDir1∂}∂"; ∂
  121.     Set Exit 1; ∂
  122.   "
  123.  
  124. AddMenu File 'Show WorkSet...' ∂
  125.   " ∂
  126.     Set CurDir1 ∂`Directory∂`; ∂
  127.     Directory ∂"{MPW}WorkSets:∂"; ∂
  128.     Set Exit 0; ∂
  129.     Set xxxWorkSetList ∂"∂`Files∂`∂"; ∂
  130.     If (∂"∂{xxxWorkSetList∂}∂" == ∂"∂"); ∂
  131.         Alert "There are no WorkSets currently defined."; ∂
  132.     Else; ∂
  133.         Set xxxAWorkSet ∂"∂`GetListItem ∂{xxxWorkSetList∂} -m 'Select WorkSet:'; Set xStatus ∂{Status∂};∂`∂"; ∂
  134.         If (∂{xStatus∂} == 0); ∂
  135.             ShowWindows ∂`Catenate ∂{xxxAWorkSet∂}∂`; ∂
  136.         End; ∂
  137.     End; ∂
  138.     Directory ∂"∂{CurDir1∂}∂"; ∂
  139.     Set Exit 1; ∂
  140.   "
  141.  
  142. AddMenu File 'Hide WorkSet...' ∂
  143.   " ∂
  144.     Set CurDir1 ∂`Directory∂`; ∂
  145.     Directory ∂"{MPW}WorkSets:∂"; ∂
  146.     Set Exit 0; ∂
  147.     Set xxxWorkSetList ∂"∂`Files∂`∂"; ∂
  148.     If (∂"∂{xxxWorkSetList∂}∂" == ∂"∂"); ∂
  149.         Alert "There are no WorkSets currently defined."; ∂
  150.     Else; ∂
  151.         Set xxxxxxAWorkSet ∂"∂`GetListItem ∂{xxxWorkSetList∂} -m 'Select WorkSet:'; Set xStatus ∂{Status∂};∂`∂"; ∂
  152.         If (∂{xStatus∂} == 0); ∂
  153.             HideWindows ∂`Catenate ∂{xxxAWorkSet∂}∂`; ∂
  154.         End; ∂
  155.     End; ∂
  156.     Directory ∂"∂{CurDir1∂}∂"; ∂
  157.     Set Exit 1; ∂
  158.   "
  159.  
  160.  
  161. AddMenu File '(-10' ''
  162.  
  163. #
  164. # Now add one more item, just in case you want to unclutter your "File" menu.
  165. #
  166. AddMenu File 'Kill WorkSet Dialogs' " ∂
  167.     DeleteMenu File '(-8'; ∂
  168.     DeleteMenu File '(-9'; ∂
  169.     DeleteMenu File '(-10'; ∂
  170.     DeleteMenu  File 'Edit WorkSet...' ; ∂
  171.     DeleteMenu  File 'Remove WorkSet...' ; ∂
  172.     DeleteMenu  File 'Open WorkSet...' ; ∂
  173.     DeleteMenu  File 'Close WorkSet...' ; ∂
  174.     DeleteMenu  File 'Show WorkSet...' ; ∂
  175.     DeleteMenu  File 'Hide WorkSet...' ; ∂
  176.     DeleteMenu  File 'Kill WorkSet Dialogs' ; ∂
  177.     "
  178.  
  179.  
  180. ### Open - File:   Error: File name is too long or path is incorrect.
  181.